/*
 * Description: 删除不属于`antd`组件的属性，返回新props对象
 * Author: wangyifei
 * Date: 2023-06-13 11:01
 */
import { useMemo } from 'react';

export const useRemoveCustomProps = <T = { [key: string]: any }>(props: T, keys: any) => {
	const newProps = useMemo(() => {
		const newProps = { ...props };
		for (const key of keys) {
			delete (newProps as { [key: string]: any })[key];
		}
		return newProps;
	}, [props]);
	return newProps;
};
